package net;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

/**
 * @author： pang-yun
 * @date： 2021-09-06 10:02
 * 功能目的 ：用于  向服务器 发送消息
 */

public class Client {
    public static void main(String[] args) throws IOException {
        SocketChannel socketChannel = SocketChannel.open();
        socketChannel.connect(new InetSocketAddress(9999));
        socketChannel.write(Charset.defaultCharset().encode("中"));
        System.out.println("waiting!!!");


    }

}
